<template>
  <el-container style="height: 100vh;">
    <el-container>
      <!-- 侧边栏 -->
      <sidebar />

      <!-- 主内容区 -->
      <el-main class="main-content">
          <!-- 顶部导航栏 -->
        <router-view />
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import TopNav from './components/TopNav.vue';
import Sidebar from './components/Sidebar.vue';
import { useChatStore } from '@/stores/chat'; // 引入 Chat Store
export default {
  components: {
    TopNav,
    Sidebar,
  },
  setup() {
    const chatStore = useChatStore(); // 使用 Chat Store
    chatStore.initUUID(); // 初始化用户 UUID
  },
};
</script>

<style scoped>
.main-content {
  padding: 0;
  margin: 0;
  flex: 1;
  width: 100%;
  min-width: 0;
}

.el-container {
  display: flex;
  flex-direction: row;
  height: 100%;
}

.el-main {
  padding: 0;
  margin: 0;
  flex: 1;
}
</style>
